<!DOCTYPE html>
<html>
	<head>
		<title>jQuery replaceWith()</title>
		<meta charset="utf=8" />
	</head>

	<body>
		<div id="container">
			<div class="inner first">First</div>
			<div class="inner second">Second</div>
			<div class="inner third">Third</div>
		</div>
		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
		<script type="text/javascript">
			$('div.second').replaceWith('<h1>Second</h1>');
		</script>
	</body>
</html>

